<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>报损审核</title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/admin_css/list_style.css"/>
        <link rel="stylesheet" type="text/css" href="../../../resource/layui/css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/niubility.css"/>
        <script type="text/javascript" src="../../../resource/layui/layui.js"></script>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.css"/>
    </head>
	<body>
		<!--详情：弹出层-->
		<div class="popUp" id="popUp">
			<table class="table table-bordered table-hover"></table>
		</div>
	
		<div class="bs">
			<input type="button" id="totalSelection" value="全部选中" />
			<input type="button" id="sure" value="审核" />
		</div>

		<table class="layui-table">
			<!-- 数据的改变区域 -->
			<tbody id="infoBox"></tbody>
			<!--用来分页的div-->
			<div class="fenBox">
				<div id="pagination1"></div>
			</div>
		</table>
		<script type="text/javascript" src="../../../resource/js/jquery.min.js"></script>
		<!--***************所有的静态路径****************-->
		<script src="../../../resource/js/static_url.js"></script>
		<!-- 共同一套：生成信息列表 + 弹出层退回去的代码 -->
		<script src="../../../resource/js/admin_js/admin_review_list.js"></script>
		<!--  购买 、 调入 、调出 、 报损报废的审核函数  -->
		<script src="../../../resource/js/admin_js/admin_review_four.js"></script>
		<script type="text/javascript">
			//（1）渲染待审核信息列表
            myAjax_list_popup(admin_damage,'1');
            //（2）审核
            $("#sure").click(function(){
                //参数为： 批量审核post的那种
                examine(admin_damage_review,admin_damage);
                $("#totalSelection").val("全部选中");
                flag = 1;
            });
            //（3）详情
            function details(that){
                //拿出一个id ,点击第几个，我就拿第几条数据中一个id
                var ids = $(that).attr("data-id");
                $.ajax({
                    url: admin_damage_details+ids,
                    type:"GET",
                    async: true,
                    dataType:"json",
                    success: function(info){
                        if(info.code != 0){
                            layui.use('layer', function(){
                                var layer = layui.layer;
                                layer.msg(info.msg, {skin:'tip_position',time:'3000'});
                            });
                            return;
                        }

                        var obj1 = info.data;
                        var str1 = "";
                        str1+=
                            '<tr>'+
							    '<td>设备类别</td>'+
								'<td>设备编号</td>'+
								'<td>设备名称</td>'+
								'<td>经手人</td>'+
								'<td>报损日期</td>'+
								'<td>报损原因</td>'+
								'<td>使用年限</td>'+
                            '</tr>'+
                            '<tr>'+
                                '<td>'+obj1.equipmentCategory+'</td>'+
								'<td>'+obj1.equipmentNo+'</td>'+
								'<td>'+obj1.equipmentName+'</td>'+
								'<td>'+obj1.handMan+'</td>'+
								'<td>'+obj1.damageDate+'</td>'+
								'<td>'+obj1.damageReason+'</td>'+
								'<td>'+obj1.useYear+'</td>'+
                            '</tr>';

                        $("#popUp table").eq(0).html(str1);
                        //让内容以弹出层的方式显示出来。
                        $("#popUp").attr({"class":"popUpClick"});
                        // 动态计算 #popUp 的宽度
                        var width_fen = parseInt( $("#popUp").css("width") );
                        width_fen = 801;
                        $("#popUp")[0].style.marginLeft = -width_fen/2-120-60+'px';
                    },
                    error:function(){
                        layui.use('layer', function(){
                            var layer = layui.layer;
                            layer.msg('系统错误！！！', {skin:'tip_position',time:'3000'});
                        });
                    }
                }); //ajax结束

            }
		</script>			
	</body>
</html>
